#ifndef  GSMEG_LINK_MAP_H
#define  GSMEG_LINK_MAP_H

#include "gsmeg_link_info.h"
#include "ac_util.h"
typedef z_hash_t gsmeg_link_map_t; 

gsmeg_link_map_t *gsmeg_link_map_create(void);
void gsmeg_link_map_destroy(gsmeg_link_map_t *map);

int gsmeg_link_map_onconnected(gsmeg_link_map_t *map,long long channel);
int gsmeg_link_map_ondisconnected(gsmeg_link_map_t *map,long long channel);
int gsmeg_link_map_onlogined(gsmeg_link_map_t *map,long long channel);

//!!!NOTICE: <char *gsemg_msg> need to be free by yourself
void gsmeg_link_map_push_to_all_valid_link(gsmeg_link_map_t *map,char *gsmeg_msg,int con_len,int cmd);
void gsmeg_link_map_push_to_one_valid_link(gsmeg_link_map_t *map,char *gsmeg_msg,int con_len,int cmd);
void gsmeg_link_map_push_by_channel(gsmeg_link_map_t *map,long long channel,char *gsmeg_msg,int con_len,int cmd);

int gsmeg_link_map_is_valid_channel(gsmeg_link_map_t *map,long long channel);

/* 
void gsmeg_link_map_foreach_connect(gsmeg_link_map_t *map);
void gsmeg_link_map_foreach_disonnect(gsmeg_link_map_t *map);
void gsmeg_link_map_foreach_cb(gsmeg_link_map_t *map,gsmeg_link_map_cb_t cb,void *ctx);
*/

#endif   /* GSMEG_LINK_MAP_H */
